package StoreManage.sDeleteMan;

import StoreManage.sMenu.sMenu;
import javafx.application.Application;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.control.Button;
import javafx.scene.control.TextField;
import javafx.scene.control.TableView;
import javafx.scene.control.Label;

/*删除售货员信息，输入sid，点击删除按钮，删除整条记录*/
public class sDeleteMan extends Application {

    @FXML
    private Label s3;        //显示删除成功与否

    @FXML
    private TableView<?> s4;     //显示所有售货员

    @FXML
    private Button back;        //返回二级页面按钮

    @FXML
    private TextField s1;     //输入售货员ID

    @FXML
    private Button s2;        //删除按钮


    @Override
    public void start(Stage primaryStage) {
        try {
            Class clazz = getClass();
            Parent parent = FXMLLoader.load(clazz.getResource("sDeleteMan/sDeleteMan.fxml"));
            Scene scene = new Scene(parent, 600, 600);
            scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
            primaryStage.setScene(scene);
            primaryStage.show();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @FXML
    //输入售货员ID
    public void sDeleteID(){

    }

    @FXML
    //点击删除按钮
    public void sDelete(){

    }



    @FXML
    //返回到二级页面，商店管理
    public void sBack(){
        try {
            new sMenu().start(new Stage());   //返回到商品管理界面

        } catch (Exception e) {
            // TODO: handle exception
        }
        exitButtonOnMouseClicked(back);

    }

       //关闭本界面
    private void exitButtonOnMouseClicked(Button exitButton) {
        Stage stage = (Stage) exitButton.getScene().getWindow();
        stage.close();
    }

}
